package com.onlineMIS.ORM.DAO.headQ.systemFile;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.onlineMIS.ORM.DAO.BaseDAO;
import com.onlineMIS.ORM.entity.headQ.barcodeGentor.SystemFile;

@Repository
public class SystemFileDaoImpl extends BaseDAO<SystemFile>{

	
	public SystemFile selectFileByName(String fileName) {
		DetachedCriteria criteria = DetachedCriteria.forClass(SystemFile.class);
		criteria.add(Restrictions.eq("fileName", fileName));
		List<SystemFile> files = this.getByCritera(criteria, true);
		if (files.size() > 0)
			return files.get(0);
		else 
			return null;
	}


}
